package com.cat.dataStructure;

/**
 * @author 曲大人的喵
 * @description https://leetcode.cn/problems/water-bottles-ii/?envType=daily-question&envId=2025-10-02
 * @create 2025/10/2 16:13
 * @since JDK17
 */

public class Solution91 {
    public int maxBottlesDrunk(int numBottles, int numExchange) {
        int ans = numBottles, empty = numBottles;
        while (empty >= numExchange) {
            ans++;
            empty -= numExchange++ - 1;
        }

        return ans;
    }
}
